home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _6E35DAE47D444C11952B931B569B8105 < prev    next >
Encoding:
Text File  |  2004-01-06  |  2.7 KB  |  82 lines

  1. --------------------------------------------------
  2. --    Created By: Petar
  3.  
  4.  
  5. AIBehaviour.ChimpSurround = {
  6.     Name = "ChimpSurround",
  7.  
  8.  
  9.     ---------------------------------------------
  10.     OnPlayerSeen = function( self, entity, fDistance )
  11.         -- called when the enemy sees a living player
  12.         entity:SelectPipe(0,"abberation_hang_back");
  13.         entity:InsertSubpipe(0,"DropBeaconAt");
  14.     
  15.     end,
  16.     ---------------------------------------------
  17.     OnEnemyMemory = function( self, entity )
  18.         -- called when the enemy can no longer see its foe, but remembers where it saw it last
  19.         entity:SelectPipe(0,"run_to_beacon");
  20.     end,
  21.     ---------------------------------------------
  22.     OnInterestingSoundHeard = function( self, entity )
  23.         -- called when the enemy hears an interesting sound
  24.         entity:InsertSubpipe(0,"DropBeaconAt");
  25.     end,
  26.     ---------------------------------------------
  27.     OnThreateningSoundHeard = function( self, entity )
  28.         -- called when the enemy hears a scary sound
  29.         entity:InsertSubpipe(0,"DropBeaconAt");
  30.     end,
  31.     ---------------------------------------------
  32.     OnReload = function( self, entity )
  33.         -- called when the enemy goes into automatic reload after its clip is empty
  34.     end,
  35.     ---------------------------------------------
  36.     OnGroupMemberDied = function( self, entity )
  37.         -- called when a member of the group dies
  38.     end,
  39.     ---------------------------------------------
  40.     OnNoHidingPlace = function( self, entity, sender )
  41.         -- called when no hiding place can be found with the specified parameters
  42.     end,    
  43.     ---------------------------------------------
  44.     OnReceivingDamage = function ( self, entity, sender)
  45.         entity:InsertSubpipe(0,"chimp_hurt");
  46.     end,
  47.     --------------------------------------------------
  48.     OnBulletRain = function ( self, entity, sender)
  49.         -- called when the enemy detects bullet trails around him
  50.     end,
  51.     --------------------------------------------------
  52.     OnCloseContact = function ( self, entity, sender)
  53.         local rnd=random(1,5);
  54.         entity:SelectPipe(0,"abberation_melee");
  55.         entity:InsertMeleePipe("attack_melee"..rnd);
  56.     end,
  57.     --------------------------------------------------
  58.  
  59.  
  60.     SELECT_MOVEMENT = function ( self, entity, sender)
  61.         local rnd = random(1,4);
  62.         if (rnd==1) then 
  63.             entity:InsertSubpipe(0,"abberation_hang_left");
  64.         elseif (rnd == 2) then 
  65.             entity:InsertSubpipe(0,"abberation_hang_right");
  66.         elseif (rnd == 3) then
  67.             entity:InsertSubpipe(0,"abberation_hang_away");
  68.         else
  69.             entity:InsertSubpipe(0,"abberation_wait_back");
  70.         end
  71.  
  72.     end,
  73.  
  74.     --------------------------------------------------
  75.     --------------------------------------------------
  76.     SWITCH_TO_ABBERATION_ATTACK = function ( self, entity, sender)
  77.         entity:SelectPipe(0,"abberation_attack");
  78.     end,
  79.     --------------------------------------------------
  80.  
  81.  
  82. }